#pragma once

#include "State.h"
#include "Behaviour.h"
#include "Point.h"

namespace game_engine { namespace library
{

/*!
 * \class WIRwalking
 * \brief 
 */
class WIRwalking : public game_engine::components::State
{
///////////////////////////////////////////////////////////////////////////////
// Attribute definition
///////////////////////////////////////////////////////////////////////////////
private:
    utils::Point destination;
    
///////////////////////////////////////////////////////////////////////////////
// Method definition
///////////////////////////////////////////////////////////////////////////////
public:
    // Constructors and Destructors
    WIRwalking(void);
    WIRwalking(game_engine::components::Behaviour *parent, 
        const utils::Point &dest = utils::Point());
    virtual ~WIRwalking(void);

    // Others
    void onEnter(void) throw(...);
    void onLoop(const FLOAT32 time) throw(...);
    void forceDestinationReached(void) throw(...);

    // Getters
    const utils::Point& getDestination(void) const;

    // Setters
    void setDestination(const utils::Point &dest);

private:
    const BOOL setNewPosition(const FLOAT32 time) throw(...);
    void setNewSequence(void) throw (...);
    const Direction getDirectionFromAngle(const FLOAT32 a) const;

};

}}
